<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>表单</title>
  <link rel="stylesheet" href="${ctx}/static/admin/layui/css/layui.css">
  <link rel="stylesheet" href="${ctx}/static/admin/css/formSelects-v4.css">
  </head>
  <body>
  	<div class="layui-card-body">
  	<form class="layui-form layui-form-pane">
	  <input name="tablename" type="hidden" value="${tablename! }" />
	  <input name="moduleid" type="hidden" value="${moduleid! }" />
	  <input name="target" type="hidden" value="${target! }" />
	  <input name="column_name" type="hidden" value="${column_name! }" />
	  <div class="layui-row">
	    <div class="layui-col-xs12">
	      <div class="layui-form-item">
	        <label class="layui-form-label">字段名称<font style="color: red">*</font></label>
	        <div class="layui-input-block">
		      <input type="text" name="column_comment" lay-verify="required" placeholder="请输入字段名称" autocomplete="off" class="layui-input" value="${column.column_comment!}">
		    </div>
	      </div>
	    </div>
	  </div>
	  <div class="layui-row">
	    <div class="layui-col-xs6">
	      <div class="layui-form-item">
	        <label class="layui-form-label">字段类型<font style="color: red">*</font></label>
	        <div class="layui-input-block">
		      <select name="column_type" xm-select="column_type" lay-verify="required"  xm-select-radio xm-select-search  ></select>
		    </div>
	      </div>
	    </div>
	    <div id="selectdivid" class="layui-col-xs3" style="display: none">
	      <div class="layui-form-item">
	        <label class="layui-form-label">关联表单<font style="color: red">*</font></label>
	        <div class="layui-input-block">
				<select id="foreignTableid" name="foreignTable"  lay-filter="foreignTable" lay-verify="required"  lay-search=""></select>
		    </div>
	      </div>
	    </div>
	    <div id="selectkeydivid" class="layui-col-xs3" style="display: none">
		  <div class="layui-form-item">
			  <label class="layui-form-label">关联字段<font style="color: red">*</font></label>
			  <div class="layui-input-block">
				  <select id="foreignKeyid" name="foreignKey" lay-filter="foreignKey" lay-verify="required"  lay-search=""></select>
			  </div>
		  </div>
	    </div>
	    <div id="lengthdivid" class="layui-col-xs3">
	      <div class="layui-form-item">
	        <label class="layui-form-label">字段长度<font style="color: red">*</font></label>
	        <div class="layui-input-block">
	         <input id="lengthid" type="number" name="length" lay-verify="required|number" placeholder="请输入字段长度" autocomplete="off" class="layui-input" value="${column.lengths!}">
		    </div>
	      </div>
	    </div>
	    <div id="decimaldivid" class="layui-col-xs3" style="display: none">
	      <div class="layui-form-item">
	        <label class="layui-form-label">小数点位<font style="color: red">*</font></label>
	        <div class="layui-input-block">
	         <input id="decimalid" type="number" name="decimal" lay-verify="" placeholder="请输入小数点位" autocomplete="off" class="layui-input" value="${column.decimals!}">
		    </div>
	      </div>
	    </div>
	  </div>
	  <div class="layui-row">
	    <div class="layui-col-xs6">
	      <div class="layui-form-item">
	        <label class="layui-form-label">默认值</label>
	        <div class="layui-input-block">
	         <input name="column_default" lay-verify="" placeholder="请输入默认值" autocomplete="off" class="layui-input" value="${column.column_default!}">
		    </div>
	      </div>
	    </div>
	    <div class="layui-col-xs6">
	      <div class="layui-form-item" pane="">
	        <label class="layui-form-label">是否为空<font style="color: red">*</font></label>
	        <div class="layui-input-block">
	         <%
	            var checked = 'checked';
			 	if(column.is_nullable! == 'NO'){
			 		checked = "";
			 	}
			 %>
	         <input type="checkbox" name="is_nullable" ${checked} lay-skin="switch" lay-filter="is_nullable" title="是否" lay-text="是|否">
		    </div>
	      </div>
	    </div>
	  </div>
   	  <div class="layui-form-item" style="display: none">
     	<div class="layui-input-block">
       	  <button id="submit-btn" class="layui-btn" lay-submit >立即提交</button>
          <button id="reset-btn" type="reset" class="layui-btn layui-btn-primary">重置</button>
   	    </div>
   	  </div>
	</form>
	</div>
  </body>
</html>
<script src="${ctx}/static/admin/layui/layui.js"></script>
<script src="${ctx}/static/admin/js/common.js"></script>
<script src="${ctx}/static/admin/module/columnsForm.js"></script>
<script>
    var ctx = '${ctx}', moduleid = '${moduleid!}', column_type = '${column.column_type!}', decimal = '${column.decimals!}', foreignTable = '${column.foreignTable!}', foreignKey = '${column.foreignKey!}';
</script>